import Vue from 'vue'
import Vuex from 'vuex'
import rootStore from './root'

// import { createPersistedState } from 'vuex-electron'
import createPersistedState from 'vuex-persistedstate'

import modules from './modules'

Vue.use(Vuex)

export default new Vuex.Store({
  ...rootStore,
  modules,
  plugins: [
    createPersistedState({
      key: 'gitee-helper'
    })
    // createPersistedState()
    // createSharedMutations() // 如果使用会导致 store 在后台运行，监听不到数据
  ],
  strict: process.env.NODE_ENV !== 'production'
})
